<template>
    <div id="dialog-container">
        <el-dialog v-dialogDrag 
            title="详情" append-to-body
            :visible.sync="dialogVisible" @close="$emit('update:show', false)" :before-close="handleClose" :show="show"
            :close-on-click-modal="false" width="760px">
            <el-form :model="form" :inline="true" size="small" label-width="130px">
                <el-row type="flex" justify="center" style="margin-bottom: 10px;">
                    <h2>标准样件历史记录卡</h2>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="企业名称：">
                            <el-input v-model="form.name" disabled></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="工序号：">
                            <el-input v-model="form.name"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="标准样件编号：">
                            <el-input v-model="form.name"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="零件图号：">
                            <el-input v-model="form.name"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="存放地点：">
                            <el-input v-model="form.name"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="检定部门：">
                            <el-input v-model="form.name"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="检定周期：">
                            <el-input v-model="form.name"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="使用前级数：">
                            <el-input v-model="form.name"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="使用部门：">
                            <el-input v-model="form.name"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="刻度值：">
                            <el-input v-model="form.name"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="附件：">
                            <el-input v-model="form.name"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="统一编号：">
                            <el-input v-model="form.name"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <hr>
                <el-row type="flex" justify="center">
                    <el-button type="primary" size="mini" round>周期检定结果</el-button>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="检定日期：">
                            <el-input v-model="form.date" disabled></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="检定项目：">
                            <el-input v-model="form.name"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="检定人：">
                            <el-input v-model="form.name"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="下次检定日期：">
                            <el-input v-model="form.date" disabled></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="检定结果：">
                            <el-select v-model="form.departmentVal" placeholder="请选择" style="width: 200px;">
                                <el-option v-for="item in form.department"
                                    :key="item.value" :label="item.label" :value="item.value"></el-option>
                            </el-select> 
                        </el-form-item>
                    </el-col>
                    <el-col :span="20">
                        <el-form-item label="附件：">
                            <el-button type="primary" size="small">查看</el-button>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-table :data="tableData" size="small" border stripe height="200" style="width: 96%;margin: 10px 25px;">
                        <el-table-column prop="size" label="理论尺寸" min-width="180"></el-table-column>
                        <el-table-column prop="result" label="测量结果" min-width="180"></el-table-column>
                    </el-table>
                </el-row>
                <hr class="bottomLine">
                <el-row>
                    <el-col :span="24">
                        <el-form-item label="备注：">
                            <el-input v-model="form.name" type="textarea" :row="3" style="width: 552px;"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button type="primary">修 改</el-button>
                <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
                <el-button @click="dialogVisible = false">取 消</el-button>
            </div>
        </el-dialog>
    </div>
</template>

<script>
    export default {
        data() {
            return {
                dialogVisible: this.show,
                form: {
                    name: '',
                    data: ''
                },
                tableData: []
            }
        },
        props: {
            show: {
                type: Boolean,
                default: false
            }
        },
        watch: {
            show() {
                this.dialogVisible = this.show;
            }
        },
        methods: {
            handleClose() {
                this.dialogVisible = false;
            }
        }
    }
</script>

<style scoped>
    .el-date-editor.el-input{
        width: 200px;
    }
    .el-button--mini, .el-button--mini.is-round{
        padding: 5px 10px;
        margin-bottom: 10px;
    }
</style>

